
package fileby.ctrl.actions.impl;

import fileby.model.IFileManager;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import javax.swing.AbstractAction;
import javax.swing.KeyStroke;

/**
 *
 * @author Jacob
 */
class OpenAction extends AbstractAction {

    private IFileManager fileManager;

    public OpenAction(IFileManager fileManager) {
        super("Open", null);
        this.fileManager = fileManager;
        putValue(SHORT_DESCRIPTION, "Open selected files");
        putValue(MNEMONIC_KEY, KeyEvent.VK_O);
        putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0));
    }

    public void actionPerformed(ActionEvent e) {
            fileManager.open(true);
    }

}
